package com.situ.day4;

public class Cal {
    private int num1;
    private int num2;

    public Cal() {
        super();
    }

    public Cal(int num1, int num2) {
        this.num1 = num1;
        this.num2 = num2;
    }

    //单一职责
    public int add() {
        //int result = num1 + num2;
        //System.out.println("add: " + result);
        //return result;
        return num1 + num2;
    }

    public int sub() {
        return num1 - num2;
    }

    public int multi() {
        return num1 * num2;
    }

    public int div() {
        return num1 / num2;
    }




    public int getNum1() {
        return num1;
    }

    public void setNum1(int num1) {
        this.num1 = num1;
    }

    public int getNum2() {
        return num2;
    }

    public void setNum2(int num2) {
        this.num2 = num2;
    }

    @Override
    public String toString() {
        return "Cal{" +
                "num1=" + num1 +
                ", num2=" + num2 +
                '}';
    }
}
